//
//  SDTableView.h
//  SKinDiary
//
//  Created by pcyang on 16/6/26.
//  Copyright © 2016年 tencent. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "SDEGORefreshTableHeaderView.h"
#import "SDGetMoreView.h"
#import "UITableViewCell+Util.h"

@class SDTableView;

@protocol SDTableViewDelegate <UITableViewDelegate>

@optional
//lenahe
- (void)errorViewRefreshData:(SDTableView*)tableView;
//lenahe end
@required
- (void)tableViewShouldRefreshData:(SDTableView*)tableView;
- (void)tableViewShouldLoadMoreData:(SDTableView*)tableView;
- (BOOL)tableViewDataIsLoading:(SDTableView*)tableView;
- (BOOL)tableViewHasMoreData:(SDTableView*)tableView;
- (NSDate*)tableViewDataLastUpdateTime:(SDTableView*)tableView;
@end

@interface SDTableView : UITableView<SDEGORefreshTableHeaderDelegate>
@property (nonatomic,weak) id<SDTableViewDelegate> delegate;
@property (nonatomic) BOOL preLoadMore;
@property (nonatomic,strong) SDGetMoreView* loadingMoreView;
@property (nonatomic) BOOL useLoadingMoreAsCell;
@property (nonatomic) BOOL notShowLoadingMore;
@property (nonatomic) BOOL showLoadingMoreAlways;
@property (nonatomic) CGFloat minShowLoadingMoreHeight;
@property (nonatomic,strong)UIView* scrollBGView;
@property (nonatomic,assign) UIEdgeInsets normalInset;

@property (nonatomic,strong) NSString   *refreshLoadingTip;

- (void)removeRefreshHeaderView;
- (void)addRefreshHeaderView;

- (void)scrollViewDidScroll;
- (void)scrollViewDidEndDragging;
- (void)finishedLoading;
- (void)finishedLoadingWithoutReload;

- (void)forceLoad;

- (void)setNomoreTipString:(NSString*)tipString;
- (void)setMoreTipString:(NSString*)tipString;
- (void)setRefreshTipString:(NSString*)tipString;
- (void)setTipStringColor:(UIColor*) color;


- (void)simulationRefresh;
@end

